
#include "IO.h"
#include "BSP_Config.h"

#define REALY_S_ON	1
#define REALY_S_OFF	0


static const IO_T Relay = IO_INIT_TABLE(RELAY_GP, RELAY_PIN);

void BSP_Relay_Set(uint8_t state){
	IO_Set(&Relay, state ? REALY_S_ON: REALY_S_OFF);
}

uint8_t BSP_Relay_State(void){
	uint8_t state = IO_Get(&Relay) ? 1 : 0;
	return state != REALY_S_OFF ? 1 : 0;
}

void BSP_Relay_Init(void)
{
	IO_Init(&Relay, IO_Mode_OUT);
	BSP_Relay_Set(REALY_S_OFF);
}



